<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 导入必要的CSS和JavaScript文件 -->
    <link rel="stylesheet" type="text/css" th:href="@{/css/modal.css}" />
</head>
<style>
/* modal.css */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}

.close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
    cursor: pointer;
}

</style>
<body>
    <button id="openModalBtn">打开悬浮窗</button>
    
    <!-- 定义悬浮窗的HTML结构 -->
    <div id="myModal" class="modal">
        <div class="modal-content">
            <span class="close" id="closeModalBtn">&times;</span>
            <p>这是悬浮窗的内容</p>
        </div>
    </div>
    
    <!-- 导入必要的JavaScript文件 -->
    <script type="text/javascript" th:inline="javascript">
    
 // modal.js
    document.addEventListener("DOMContentLoaded", function() {
        var modal = document.getElementById("myModal");
        var openBtn = document.getElementById("openModalBtn");
        var closeBtn = document.getElementById("closeModalBtn");

        openBtn.addEventListener("click", function() {
            modal.style.display = "block";
        });

        closeBtn.addEventListener("click", function() {
            modal.style.display = "none";
        });
    });
	<!-- var html='';
	 var result;
	for(var i=1;i<data.length;i++){
		 result=data[i];
		 for(var y=1;y<6;y++){
				if(i==result.week&&y==result.jieci){
					html+="<tr>";
	         		html+="<td>"+result.week+"</td><td>"+result.name+"</td><td>"+result.className+"</td><td>"+result.jieci+"</td><td>"+result.teacherName+"</td>";
	         		html+="<tr>";
				}
				else{
					html+="<tr>";
	         		html+="";
	         		html+="<tr>";
				}

		
	}
	}
	myTbody.innerHTML=html;

	// document.write(xhr.responseText)
	 }
	
}-->
</script>
</body>
</html>
